package com.foo.designpattern.chainofresponsibility;

/**
 * com.foo.designpattern.chainofresponsibility
 * Created with IntelliJ IDEA.
 * Created by jiang on 2016/4/21 23:02.
 *
 * @Description 抽象处理角色类
 */
public abstract class Handler {
    /**
     * 持有下一个处理请求的对象
     */
    protected Handler succerror = null;

    /**
     * 取值方法
     */
    public Handler getSuccessor() {
        return succerror;
    }

    /**
     * 设置下一个处理请求的对象
     */
    public void setSuccerror(Handler succerror) {
        this.succerror = succerror;
    }

    /**
     * 处理聚餐费用的申请
     *
     * @param user 申请人
     * @param fee  申请的钱数
     * @return 成功或失败的具体通知
     */
    public abstract String handleFeeRequest(String user, double fee);
}
